/*
* Copyright (C) 2006 Jordi Marquès Ferré
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file DUROTY.txt.
*
* Author: Jordi Marquès Ferré
* c/Mallorca 295 principal B 08037 Barcelona Spain
* Phone: +34 625397324
*/


package com.duroty.hibernate;


// Generated 31-jul-2006 11:12:15 by Hibernate Tools 3.1.0.beta5

/**
 * UserRoleId generated by hbm2java
 */
public class UserRoleId implements java.io.Serializable {
    // Fields    

    /**
     *
     */
    private static final long serialVersionUID = -52579497192010011L;

    /**
     * DOCUMENT ME!
     */
    private Users users;

    /**
     * DOCUMENT ME!
     */
    private Roles roles;

    // Constructors

    /** default constructor */
    public UserRoleId() {
    }

    /** full constructor */
    public UserRoleId(Users users, Roles roles) {
        this.users = users;
        this.roles = roles;
    }

    // Property accessors

    /**
     * DOCUMENT ME!
     *
     * @return DOCUMENT ME!
     */
    public Users getUsers() {
        return this.users;
    }

    /**
     * DOCUMENT ME!
     *
     * @param users DOCUMENT ME!
     */
    public void setUsers(Users users) {
        this.users = users;
    }

    /**
     * DOCUMENT ME!
     *
     * @return DOCUMENT ME!
     */
    public Roles getRoles() {
        return this.roles;
    }

    /**
     * DOCUMENT ME!
     *
     * @param roles DOCUMENT ME!
     */
    public void setRoles(Roles roles) {
        this.roles = roles;
    }

    /**
     * DOCUMENT ME!
     *
     * @param other DOCUMENT ME!
     *
     * @return DOCUMENT ME!
     */
    public boolean equals(Object other) {
        if ((this == other)) {
            return true;
        }

        if ((other == null)) {
            return false;
        }

        if (!(other instanceof UserRoleId)) {
            return false;
        }

        UserRoleId castOther = (UserRoleId) other;

        return ((this.getUsers() == castOther.getUsers()) ||
        ((this.getUsers() != null) && (castOther.getUsers() != null) &&
        this.getUsers().equals(castOther.getUsers()))) &&
        ((this.getRoles() == castOther.getRoles()) ||
        ((this.getRoles() != null) && (castOther.getRoles() != null) &&
        this.getRoles().equals(castOther.getRoles())));
    }

    /**
     * DOCUMENT ME!
     *
     * @return DOCUMENT ME!
     */
    public int hashCode() {
        int result = 17;

        result = (37 * result) +
            ((getUsers() == null) ? 0 : this.getUsers().hashCode());
        result = (37 * result) +
            ((getRoles() == null) ? 0 : this.getRoles().hashCode());

        return result;
    }
}
